export default [
  // user
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      { path: '/user', redirect: '/user/login' },
      { path: '/user/login', component: './User/Login' },
      { path: '/user/register', component: './User/Register' },
      { path: '/user/register-result', component: './User/RegisterResult' },
    ],
  },
  // app
  {
    path: '/',
    component: '../layouts/BasicLayout',
    Routes: ['src/pages/Authorized'],
    authority: ['admin', 'user'],
    routes: [
      { path: '/', redirect: '/collect/source-list' },
      {
        // 采集源
        name: 'collect',
        icon: 'export',
        path: '/collect',
        routes: [
          {
            path: '/collect/source-list',
            name: 'source-list',
          },
          {
            path: '/collect/source',
            name: 'source',
            hideInMenu: true,
          },
          {
            path: '/collect/type-list',
            name: 'type-list',
          },
          {
            path: '/collect/type',
            name: 'type',
            hideInMenu: true,
          },
        ],
      },
      {
        // 设备配置
        name: 'device',
        icon: 'instagram',
        path: '/device',
        routes: [
          {
            path: '/device/type-list',
            name: 'type-list',
            component: './Device/TypeList',
          },
          {
            path: '/device/type',
            name: 'type',
            hideInMenu: true,
          },
          {
            path: '/device/models',
            name: 'models',
          },
          {
            path: '/device/attributes',
            name: 'attributes',
          },
          {
            path: '/device/base-list',
            name: 'base-list',
          },
          {
            path: '/device/base',
            name: 'base',
            hideInMenu: true,
          },
          {
            path: '/device/collect-list',
            name: 'collect-list',
          },
          {
            path: '/device/collect',
            name: 'collect',
            hideInMenu: true,
          },
        ],
      },
      {
        // 任务管理
        name: 'task',
        icon: 'bars',
        path: '/task',
        routes: [
          {
            path: '/task/list',
            name: 'list',
          },
          {
            path: '/task/base',
            name: 'base',
            hideInMenu: true,
          },
        ],
      },
      {
        name: 'exception',
        icon: 'warning',
        path: '/exception',
        routes: [
          // exception
          {
            path: '/exception/403',
            name: 'not-permission',
            component: './Exception/403',
          },
          {
            path: '/exception/404',
            name: 'not-find',
            component: './Exception/404',
          },
          {
            path: '/exception/500',
            name: 'server-error',
            component: './Exception/500',
          },
          {
            path: '/exception/trigger',
            name: 'trigger',
            hideInMenu: true,
            component: './Exception/TriggerException',
          },
        ],
      },
      {
        component: '404',
      },
    ],
  },
];
